/**
 * 
 */
package com.hl.manage.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.hl.manage.interceptor.LogCostInterceptor;
import com.hl.manage.service.IGroupService;
import com.hl.manage.service.IMenuService;
/**
 * @author helei
 *
 */
@Configuration
public class ServerWebAppConfig implements WebMvcConfigurer {

	/**
	 * 
	 */
	public ServerWebAppConfig() {
		// TODO Auto-generated constructor stub
	}
    @Autowired
    private IMenuService iMenuService;

    @Autowired
    private IGroupService iGroupService;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LogCostInterceptor(iMenuService, iGroupService)).addPathPatterns("/**").excludePathPatterns("/user/login/**").excludePathPatterns("/index/**");
    }
}
